package com.ty.game.utils;

import org.springframework.context.ApplicationContext;

import java.io.Serializable;

/**
 * @author: Troy.Chen(失足程序员, 15388152619)
 * @version: 2021-08-05 17:34
 **/
public class SpringUtil implements Serializable {

    private static final long serialVersionUID = 1L;

    public static ApplicationContext CurApplicationContext;

    public static <R> R getBean(String name) {
        return (R) CurApplicationContext.getBean(name);
    }

    public static <R> R getBean(Class<R> name) {
        return (R) CurApplicationContext.getBean(name);
    }

}
